<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>帝国cms 栏目高级调用 高亮并且二级栏目增加样式_技术狂人</title>
<meta name="keywords" content="">
<meta name="description" content="帝国cms设置，一级栏目高亮，并且二级栏目增加一个类名，class=" sub"。用灵动标签可以实现，先获取一级栏目的地址，然后再判断是否是终极栏目，是的话，就添加样式sub，不是终极栏目就为空">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="static/css/base.css" rel="stylesheet">
<link href="static/css/index.css" rel="stylesheet">
<link href="static/css/info.css" rel="stylesheet">
<link href="static/css/m.css" rel="stylesheet">
<script src="static/js/jquery.min.js"></script>
<script src="static/js/jquery.easyfader.min.js"></script>
<script src="static/js/hc-sticky.js"></script>
<script src="static/js/comm.js"></script>

<script type="text/javascript" src="static/js/ajax.js"></script>
</head>
<body>
<header class="header-navigation" id="header">
  <nav>
    <div class="logo"><a href="index.html">技术狂人</a></div>
    <h2 id="mnavh"><span class="navicon"></span></h2>
 <ul id="starlist">
<li><a href="index.html">首页</a></li>
 
 
<li><a href="about.html">关于我</a></li> 
 
 
<li><a href="life.html">慢生活</a></li> 
 
 
<li class="selected"><a href="study.html">学无止境</a></li> 
 
 
<li><a href="time.html">时间轴</a></li> 
 
    </ul>
    <div class="searchbox">
    <div id="search_bar" class="search_bar">
      <form id="searchform" action="/e/search/index.php" method="post" name="searchform">
        <input class="input" placeholder="想搜点什么呢.." type="text" name="keyboard" id="keyboard">
        <input type="hidden" name="show" value="title">
        <input type="hidden" name="tempid" value="1">
        <input type="hidden" name="tbname" value="news">
        <input type="hidden" name="Submit" value="搜索">
        <p class="search_ico"> <span></span></p>
      </form>
     </div> 
    </div>
  </nav>
</header>
<article>
  <main>
  <div class="infosbox">
    <div class="newsview">
      <h3 class="news_title">帝国cms 栏目高级调用 高亮并且二级栏目增加样式</h3>
      <div class="bloginfo">
        <ul>
          <li class="author">
作者：冼子明</li>
          <li class="lmname">网站建设</li>
          <li class="timer">2018-06-17</li>
          <li class="view"><script src="static/js/-15_43_1.js"></script>人已阅读</li>
        </ul>
      </div>
      <div class="tags"></div>
      <div class="news_about"><strong>简介</strong>帝国cms设置，一级栏目高亮，并且二级栏目增加一个类名，class="sub"。用灵动标签可以实现，先获取一级栏目的地址，然后再判断是否是终极栏目，是的话，就添加样式sub，不是终极栏目就为空</div>
      <div class="news_con">         帝国cms设置，一级栏目高亮，并且二级栏目增加一个类名，class=&quot;sub&quot;。用灵动标签可以实现，先获取一级栏目的地址，然后再判断是否是终极栏目，是的话，就添加样式sub，不是终极栏目就为空<div style="background:#eee;border:1px solid #ccc;padding:5px 10px;"><p>&nbsp; &nbsp; &lt;ul id=&quot;starlist&quot;&gt;<br>&nbsp; &nbsp; &nbsp;&lt;li&gt;&lt;a href=&quot;&#091;!--news.url--]&quot; title=&quot;首页&quot;&gt;网站首页&lt;/a&gt;&lt;/li&gt;&nbsp;<br>[e:loop={&quot;select classid,classname,islast,showclass from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,classid asc&quot;,0,24,0}]&nbsp;<br>&lt;?php&nbsp;<br>$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址&nbsp;<br>$class=&quot;&quot;;&nbsp;<br>if($GLOBALS[navclassid]){&nbsp;<br>$fcr=explode(&#39;|&#39;,$class_r[$GLOBALS[navclassid]][featherclass]);&nbsp;<br>$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID&nbsp;<br>if($bqr[classid]==$topbclassid)&nbsp;<br>{&nbsp;<br>$class=&#39;class=&quot;selected&quot;&#39;;&nbsp;<br>}&nbsp;<br>}&nbsp;<br>?&gt;&nbsp;<br>&lt;li &lt;?=$class?&gt;&gt;&lt;a href=&quot;&lt;?=$classurl?&gt;&quot;&gt;&lt;?=$bqr[classname]?&gt;&lt;/a&gt;<br>&lt;?php<br>if(!$bqr[islast]) //判断是否终极栏目<br>{&nbsp;<br>$classsub=&#39;&lt;ul class=&quot;sub&quot;&gt;&#39;;&nbsp;<br>$classsubend=&#39;&lt;/ul&gt;&#39;;&nbsp;<br>}&nbsp;<br>else<br>{&nbsp;<br>$classsub=&#39;&#39;;&nbsp;<br>$classsubend=&#39;&#39;;&nbsp;<br>}<br>{<br>?&gt;<br>&nbsp; &nbsp;&lt;?=$classsub?&gt;<br>&nbsp; &nbsp; &lt;?php<br>&nbsp; &nbsp; //取得栏目下的子栏目 &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; $newsclass=$empire-&gt;query(&quot;select classid,classname from &quot;.$dbtbpre.&quot;enewsclass where bclassid=&quot;.$bqr[classid].&quot; order by myorder,classid desc&quot;);<br>&nbsp; &nbsp; while($classr=$empire-&gt;fetch($newsclass))<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; $classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址<br>&nbsp; &nbsp; &nbsp; &nbsp; ?&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;&lt;?=$classrurl?&gt;&quot; &gt;&lt;?=$classr[classname]?&gt;&lt;/a&gt;&lt;/li&gt;<br>&nbsp; &nbsp; &lt;?php<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; ?&gt;<br>&nbsp; &lt;?=$classsubend?&gt;<br>&lt;?php<br>}<br>?&gt;<br>&lt;/li&gt;&nbsp;<br>[/e:loop]&nbsp;<br>&nbsp; &nbsp; &lt;/ul&gt;</p></div><br>一级栏目高亮&ldquo;selected&rdquo;，并且增加样式&ldquo;menu&rdquo;<br>&nbsp;<div style="background:#eee;border:1px solid #ccc;padding:5px 10px;"><p><br>&lt;ul &gt;&nbsp;<br>&lt;li&gt;&lt;a href=&quot;&#091;!--news.url--]&quot; title=&quot;首页&quot;&gt;首页&lt;/a&gt;&lt;/li&gt;&nbsp;<br>[e:loop={&quot;select classid,classname,islast from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc&quot;,0,24,0}]&nbsp;<br>&lt;?php&nbsp;<br>$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址&nbsp;<br>$class=&quot;&quot;;&nbsp;<br>if($GLOBALS[navclassid]){&nbsp;<br>$fcr=explode(&#39;|&#39;,$class_r[$GLOBALS[navclassid]][featherclass]);&nbsp;<br>$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID&nbsp;<br>if($bqr[classid]==$topbclassid)&nbsp;<br>{&nbsp;<br>$class=&#39;class=&quot;selected menu&quot;&#39;;&nbsp;<br>}&nbsp;<br>else if(!$bqr[islast]) //判断是否终极栏目<br>{&nbsp;<br>$class=&#39;class=&quot;menu&quot;&#39;;&nbsp;<br>}&nbsp;<br>}&nbsp;<br>?&gt;&nbsp;<br>&lt;li &lt;?=$class?&gt;&gt;&lt;a href=&quot;&lt;?=$classurl?&gt;&quot;&gt;&lt;?=$bqr[classname]?&gt;&lt;/a&gt;<br>&nbsp; &nbsp; &lt;ul&gt;<br>&nbsp; &nbsp; &lt;?php<br>&nbsp; &nbsp; //取得栏目下的子栏目 &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; $newsclass=$empire-&gt;query(&quot;select classid,classname from &quot;.$dbtbpre.&quot;enewsclass where bclassid=&quot;.$bqr[classid].&quot; order by myorder,classid desc&quot;);<br>&nbsp; &nbsp; while($classr=$empire-&gt;fetch($newsclass))<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; $classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址<br>&nbsp; &nbsp; &nbsp; &nbsp; ?&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=&quot;&lt;?=$classrurl?&gt;&quot; target=&quot;_blank&quot;&gt;&lt;?=$classr[classname]?&gt;&lt;/a&gt;&lt;/li&gt;<br>&nbsp; &nbsp; &lt;?php<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; ?&gt;<br>&nbsp; &nbsp; &lt;/ul&gt;<br>&lt;/li&gt;&nbsp;<br>[/e:loop]&nbsp;<br>&lt;/ul&gt;<br>&lt;style&gt;<br>.selected &gt; a{color:red}<br>&lt;/style&gt;</p></div>       </div>
    </div>
    <div class="share">
<p class="diggit"><a href="JavaScript:makeRequest('/e/public/digg/?classid=15&id=43&dotop=1&doajax=1&ajaxarea=diggnum','EchoReturnedText','GET','');"> 很赞哦！ </a>(<b id="diggnum"><script type="text/javascript" src="static/js/-12_57_5.js"></script></b>)</p>

</div>
    <div class="nextinfo">
      <p>上一篇：<a href='42.html'>个人博客用帝国cms 自定义页面 灵动标签调用网站所有信息</a></p>
      <p>下一篇：<a href='44.html'>帝国cms 列表页调用子栏目，没有则不显示栏目名称</a></p>
    </div>
  </div>
  </main>
  <aside id="stickMe">
    <div class="r_box">     
      <div class="tuijian">
        <h2 id="tab"><a href="#" class="current">点击排行</a><a href="#">站长推荐</a></h2>       
     <div id="content">
        <ul style="display:block;">
          <li><a href="35.html" target="_blank">帝国cms列表页调用关键字tag标签 </a></li>
          <li><a href="37.html" target="_blank">个人博客模板《More》后台管理 </a></li>
          <li><a href="45.html" target="_blank">个人博客模板《绅士》后台管理 </a></li>
          <li><a href="" target="_blank">帝国cms 栏目高级调用 高亮并且二级栏目增加样... </a></li>
          <li><a href="36.html" target="_blank">帝国cms去掉广告图片的高和宽 </a></li>
          <li><a href="46.html" target="_blank">常用的js固定层代码 </a></li>
          <li><a href="40.html" target="_blank">个人博客模板《show time》后台管理 </a></li>
          <li><a href="39.html" target="_blank">帝国cms 如何使用静态页面？ </a></li>
          <li><a href="38.html" target="_blank">帝国cms结合项如何实现多条件查询 </a></li>
          <li><a href="44.html" target="_blank">帝国cms 列表页调用子栏目，没有则不显示栏目... </a></li>
          <li><a href="42.html" target="_blank">个人博客用帝国cms 自定义页面 灵动标签调用网... </a></li>
          <li><a href="41.html" target="_blank">帝国cms 封面模板标题调用栏目别名的方法 </a></li>
        </ul>             
        <ul>
          <li><a href="35.html" target="_blank">帝国cms列表页调用关键字tag标签 </a></li>
        </ul>
       </div>
      </div>
 <div class="wdxc">
        <h2>图文精选</h2>
        <ul>
                     <li><a href="33.html" title="从摄影作品中获取网页颜色搭配技巧" target="_blank"><img src="static/picture/9b5abf501a88ea5d80c3ccd9978358c9.jpg"></a></li>
                     <li><a href="17.html" title="或许换一个活法,能让你走出阴霾" target="_blank"><img src="static/picture/43baa4c7c03ed66bae98696de5ebc64e.jpg"></a></li>
                     <li><a href="30.html" title="css技巧以及经验总结" target="_blank"><img src="static/picture/ce3c6881c5f27e55588f8f9843d8be38.jpg"></a></li>
                     <li><a href="32.html" title="鼠标悬停图片、文字css3效果" target="_blank"><img src="static/picture/12f33cc4c1c692e2fa0017275fcc265f.jpg"></a></li>
                     <li><a href="27.html" title="帝国cms常用标签调用方法总结（不得不收藏哦）" target="_blank"><img src="static/picture/a0b65d3d8160f90f6556c4dfa3a85a59.jpg"></a></li>
                     <li><a href="29.html" title="IE6到底哪里不好？你还继续用IE6吗？" target="_blank"><img src="static/picture/b1d8cde248671b1e75ef302609595b1f.jpg"></a></li>
                   </ul>
      </div>
<div class="cloud">
      <h2>标签云</h2>
      <ul>
 <a href="tags.html" target="_blank">云南</a>      </ul>
    </div>
      <div class="guanzhu">
        <h2>关注我 么么哒</h2>
        <ul>
          <img src="static/picture/wx.png">
        </ul>
      </div>
    </div>
  </aside>
</article>
<footer>
  <p>Design by <a href="index.html" target="_blank">技术狂人</a> <a href="http://beian.miit.gov.cn/get="_blank">粤ICP备2024236460号-4</a></p>
</footer>
<a href="#" class="cd-top">Top</a><script src="static/js/js.js"></script></body>
</html>
